package com.lmf.cmsservice.controller;

import com.lmf.cmsservice.entity.CrmBanner;
import com.lmf.cmsservice.service.CrmBannerService;
import com.lmf.resultCode.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(description = "前台banner，幻灯片管理器")
@CrossOrigin
@RestController
@RequestMapping("/cmsservice/bannerFront")
public class BannerFrontController {

    @Autowired
    private CrmBannerService crmBannerService;

    @ApiOperation("查询所有幻灯片")
    @GetMapping("/getAllBanner")
    public R getAllBanner(){
        List<CrmBanner> list = crmBannerService.getAllBanner();
        return R.ok().data("list",list);
    }
}
